#!/bin/bash
set -xe  # Exit on error and print commands

# Define the range of examples (1 to 7)
EXAMPLES=({1..7})

# Path to your test folder containing example .gitmodules files
TEST_BASE="test-folder"

# Process each example
for num in "${EXAMPLES[@]}"; do
    # Path to the current example's .gitmodules
    GITMODULES_PATH="${TEST_BASE}/example${num}/.gitmodules"
    
    echo "=== Processing example ${num}: ${GITMODULES_PATH} ==="
    
    # Clean up previous test artifacts
    make test-cleanup
    
    # Run your Go tool with the current example's .gitmodules
    go run main.go "${GITMODULES_PATH}"
    
    echo "=== Completed example ${num} ==="
    echo "----------------------------------------"
done

echo "All examples processed successfully"
